
/*
 * @Description: 
 * @Author: rendc
 * @Date: 2025-02-28 14:27:14
 * @LastEditors: rendc
 * @LastEditTime: 2025-02-28 14:49:02
 */
public class Test06 {
  public static void main(String[] args) {
    // System.out.println("Hello Test06!");
    int[] array = { 1, 200, 2, 3, 4, 5, 80 };
    // int[] array = { -5, -15 };
    int maxNumber = getMax(array);
    System.out.println("该数组的最大值是：" + maxNumber);
  }

  public static int getMax(int[] arr) {
    int max = arr[0];
    // 遍历数组，求最大值
    for (int i = 0; i < arr.length; i++) {
      if (arr[i] > max) {
        max = arr[i];
      }
    }
    // 返回最大值
    return max;
  }
}